﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<AgriMarketWebProj.AgriMarketService.Auction>>" %>
<%@ Import Namespace="AgriMarketWebProj.AgriMarketService" %>
<%@ Import Namespace="AgriMarketWebProj.Models" %>
<%@ Import Namespace="System.Web.Script.Serialization" %>
<%@ Import Namespace="System.Web.Helpers" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    AgriMarket|Quản trị đấu giá
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="Content" runat="server">
    <h2>Danh sách đấu giá</h2>
    <%=Html.ValidationSummary(false) %>
    
<p>
    <%: Html.ActionLink("Create New", "Create") %>
</p>
<table class="table tableStatistic" id="BidListMoreTable">
    <tr>
        <th>
            AuctionId
        </th>
        <%--<th>
            PostedDate
        </th>--%>
        <th>
            Kiểu
        </th>
        <th>
            Topic
        </th>
        <th>
            InitialPrice
        </th>
<%--        <th>
            ProductDescription
        </th>--%>
        <th>
            StartedDate
        </th>
        <th>
            FinishedDate
        </th>
        <%--<th>
            ProductImage
        </th>--%>
        <th>
            AuthorId
        </th>
        <th></th>
    </tr>
    
<% foreach (var item in Model) { %>
    <tr>
        <td>
            <%: Html.DisplayFor(modelItem => item.AuctionId) %>
        </td>
<%--        <td>
            <%: Html.DisplayFor(modelItem => item.PostedDate) %>
        </td>--%>
        <td>
            <%: Html.DisplayFor(modelItem => item.Type.TypeName) %>
        </td>
        <td>
            <%: Html.DisplayFor(modelItem => item.Topic) %>
        </td>
        <td>
            <%: Html.DisplayFor(modelItem => item.InitialPrice) %>
        </td>
<%--        <td>
            <%: Html.DisplayFor(modelItem => item.ProductDescription) %>
        </td>--%>
        <td>
            <%: Html.DisplayFor(modelItem => item.StartedDate) %>
        </td>
        <td>
            <%: Html.DisplayFor(modelItem => item.FinishedDate) %>
        </td>
<%--        <td>
            <%: Html.DisplayFor(modelItem => item.ProductImage) %>
        </td>--%>
        <td>
            <%: Html.DisplayFor(modelItem => item.AuthorId) %>
        </td>
        <td>
        <%if (item.StartedDate > DateTime.Now)
          { %>
            <%: Html.ActionLink("Edit", "Edit", new { id = item.AuctionId })%> |
            <%} %>
            <%: Html.ActionLink("Delete", "Delete", new { id = item.AuctionId })%>
            
        </td>
    </tr>
<% } %>
    
    </table>
</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="ScriptContent" runat="server">
    <link href="../../Content/Statistic.css" rel="stylesheet" type="text/css" />
    <link href="../../Content/danhsachdaugiaMore.css" rel="stylesheet" type="text/css" />
</asp:Content>

<%--<asp:Content ID="Content4" ContentPlaceHolderID="RightPanel" runat="server">
</asp:Content>--%>
